home *** CD-ROM | disk | FTP | other *** search
/ PC Kids 1996 January / PC Kids - January 1996.iso / dksetup / dksetup.mst < prev    next >
Encoding:
Text File  |  1995-11-15  |  22.1 KB  |  682 lines

  1. ''$DEFINE DEBUG
  2. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3. '   SAMPLER (UK)
  4. '
  5. '   uses VforW & Wing
  6. '
  7. '   VERSION
  8. '   -------
  9. '   08/11/95 Use the test for cirrus logic dirvers all of the time, not just
  10. '            when bundled with a sampler.
  11. '
  12. '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  13. '
  14. '03/11/95 Cater for Win32s install and general tidy up of this script file.
  15. '         Unfortunately still need to use comments to select / deselect
  16. '         the specific font code parts.
  17. '18/08/95 rc and this have no min install. Changed dlg boxes custom,
  18. '         custom help and speed
  19. '18/08/95 Register notes most recent lang used
  20. '11/08/95 Register created using inf file
  21. '26/07/95 Uninstall code added
  22. '07/07/95 Correct dkgen.inc so unregisters use of ctl3d
  23. '04/07/95 Make sure files in bin section of inf file 'always' overwrite
  24. '28/07/95 Ini file not created for minimum install, uses file provided in dkcode
  25. '27/06/95 Test for directory names max 8 chars
  26. '26/06/95 For minimum install, ini file is now not installed
  27. '19/06/95 Moved test for cirrus drivers to mst file as only applies to sampler
  28. '05/06/95 Fonts installed on users machine
  29. '01/06/95 No choice about adding icon to prog man, altered dkgen.inc & rc file
  30. '            (custom, customhelp & speed dlg boxes need changing)
  31. '22/05/95 Code for bundling with sampler
  32. '22/05/95 Large readme need Write (will need to change dlg box in rc file)
  33. '15/05/95 No warning that directory does not exist
  34. '03/05/95 Ini file put in executable directory rather than Windows dir to stop
  35. '            clash with foreign products with same name files
  36.  
  37. '------------------------------------------------------------------------------
  38. '
  39. '+++
  40. '   Defines for setup flow control
  41. '   Comment out if not needed
  42. '$DEFINE SCRUNGED               '   Scrunged, i.e. using the .png
  43. '$DEFINE UNINSTALL              '   Take a wild guess!
  44. '$DEFINE USE_WING               '   Later Products Only or V1.1 + of older ones.
  45. ''$DEFINE WITH_SAMPLER           '   Bundled with a Sampler prog. Custmenu.exe is included.
  46. ''$DEFINE WIN32S_REQUIRED        '   Win32s is required for this product (or the sampler) to work.
  47. '---
  48.  
  49. '$INCLUDE 'dkgen.inc'
  50.  
  51. '+++
  52. '$IFDEF WIN32S_REQUIRED
  53.  
  54. '$INCLUDE 'win32s.inc'
  55.  
  56. '$ENDIF
  57. '---
  58.  
  59. '------------------------------------------------------------------------------
  60.  
  61. DECLARE FUNCTION TestForCirrus LIB "dkutils.dll" () As INTEGER
  62.  
  63. '+++
  64. '$IFDEF WITH_SAMPLER
  65.  
  66. CONST SAMPLER_PATH = "SAMPLER"
  67. CONST APPLICATION_MENU_FILE = "custmenu.exe"
  68. CONST SAMPLER_EXE_FILE = "sampler.exe"
  69.  
  70. '$ENDIF
  71. '---
  72.  
  73. 'IF USING SPECIFIC FONTS
  74. 'DECLARE FUNCTION InstallFont LIB "dkutils.dll" (szFont$) AS INTEGER
  75. 'DECLARE SUB UpdateFonts()
  76.  
  77.  
  78. '+++
  79. '$IFDEF UNINSTALL
  80.  
  81. CONST STR_UNINSTALL = "DKMM Uninstall"
  82. CONST LANG_DLL = "Unlang.eng"     'will use as default if can't find dll to match window lang
  83.  
  84. '$ENDIF
  85. '---
  86.  
  87. ' Paths and INI stuff
  88. CONST APPLICATION_INI_FILE = "sampler.ini"
  89. CONST APPLICATION_EXE_FILE = "sampler.exe"
  90. CONST APPLICATION_PENGE_FILE = "sampler.png"
  91.  
  92. CONST INI_FILE_SOURCE = "AppPath" ' OR  "WinPath"
  93. CONST EDITOR_EXE =  "write.exe " 'OR "notepad.exe "
  94.  
  95. ' Language dependant strings
  96. CONST APPLICATION_README_FILE = "readme.wri"
  97. CONST STR_README = "Dorling Kindersley Sampler Read Me"
  98. CONST ORDER_FILE = "order.wri"
  99. CONST STR_ORDER = "Ordering Information"
  100. CONST STR_MSGCAPTION = "Dorling Kindersley Sampler Setup"
  101. CONST STR_PRODUCTNAME = "Dorling Kindersley Sampler"
  102. CONST DEFAULT_INSTALL_PATH = "\DKMM\SAMPLER"
  103.  
  104.  
  105. DECLARE SUB CreateReg()
  106. DECLARE SUB Install()
  107. DECLARE SUB AddFilesToCopyList(szInstallType$)
  108. DECLARE FUNCTION IsCDROMDrive LIB "dkutils.dll" (wDrive%) As INTEGER
  109. DECLARE FUNCTION DeleteFiles LIB "dkutils.dll" (szDiffPath$, szProdName$, szDKREgIni$) AS INTEGER
  110. DECLARE FUNCTION DeleteDir LIB "dkutils.dll" (szDiffPath$) AS INTEGER
  111. DECLARE FUNCTION DeleteSection LIB "dkutils.dll" (szProdName$, szDKREgIni$) AS INTEGER
  112.  
  113.  
  114. Init:
  115.    Initialise STR_PRODUCTNAME, DEFAULT_INSTALL_PATH, STR_MSGCAPTION
  116.  
  117. WelcomeDlg:
  118.     if Welcome() = NAV_BACK then
  119.         ' Don nothing - cant go back
  120.     end if
  121.  
  122.     if TestSystem() = NAV_BACK then
  123.         goto WelcomeDlg
  124.     end if
  125.  
  126.  
  127. '+++
  128. '$IFDEF WIN32S_REQUIRED
  129.  
  130.     goto InstallWin32s
  131.  
  132. '$ENDIF
  133. '---
  134.  
  135.  
  136.     'TestCirrus:
  137.     if TestForCirrus() = 1 then
  138.         dButton = DoMsgBox(STR_CIRRUS, szMsgCaption$, MB_OK+MB_TASKMODAL+MB_ICONINFORMATION)
  139.     end if
  140.  
  141.  
  142. '+++
  143. '$IFNDEF USE_WING and NOT WITH_SAMPLER
  144. 'If old prod and not with sampler
  145.  
  146.     UpdateADPCMDrivers
  147.  
  148. '$ENDIF
  149. '---
  150.  
  151.  
  152. ExpressCustomDlg:
  153.     ' defaults to Express
  154.     'if szExpressCustomChoice = "EXPRESS" then
  155.     '    SetSymbolValue "RadioDefault", "1"
  156.     'else
  157.     '    SetSymbolValue "RadioDefault", "1"
  158.     'end if
  159.  
  160. ECDlgLoop:
  161.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_SPEED, "FRadioDlgProc", IDD_WHIZZHELP, PROC_HELP)
  162.  
  163.     select case szButton
  164.     case "REACTIVATE"
  165.         goto ECDlgLoop
  166.     case "BACK"
  167.         UIPop 1
  168.         goto WelcomeDlg
  169.     case "CONTINUE" ' Install
  170.         UIPop 1
  171.         if GetSymbolValue("ButtonChecked") = "1" then
  172.             szExpressCustomChoice = "EXPRESS"
  173.             goto ExpressInstallLoop
  174.         else
  175.             szExpressCustomChoice = "CUSTOM"
  176.             goto CustomInstallLoop
  177.         end if
  178.     case "EXIT" , "CANCEL"
  179.         AskQuit
  180.         goto ECDlgLoop
  181.     end select
  182.  
  183.  
  184. CustomInstallLoop:
  185. GetPathDlg:
  186.     SetSymbolValue "EditTextIn", szDestPath
  187.     szOldDestPath = szDestPath
  188.     SetSymbolValue "EditFocus", "ALL"
  189.  
  190. GetPathDlgLoop:
  191.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_DESTPATH, "FEditDlgProc", IDD_PATHHELP, PROC_HELP)
  192.  
  193.     select case szButton
  194.     case "REACTIVATE"
  195.         goto GetPathDlgLoop
  196.  
  197.     case "BACK"
  198.         UIPop 1
  199.         szDestPath = szOldDestPath
  200.         goto ECDlgLoop
  201.  
  202.     case "CONTINUE"
  203.         UIPop 1
  204.         szDestPath = GetSymbolValue("EditTextOut")
  205.  
  206.         if mid$(szDestPath, 2, 1) = ":" and mid$(szDestPath, 3, 1) <> "\" then
  207.             szTemp$ = mid$(szDestPath, 1, 2) + "\" + mid$(szDestPath, 3, len(szDestPath)-2)
  208.             szDestPath = szTemp
  209.         end if
  210.  
  211.         if mid$(szDestPath, 2, 1) <> ":" then
  212.             if mid$(szDestPath, 1,1) <> "\" then
  213.                 szDestPath = mid$(szWinPath, 1,1) + ":\" + szDestPath
  214.             else
  215.                 szDestPath = mid$(szWinPath, 1,1) + ":" + szDestPath
  216.             end if
  217.         elseif IsDriveValid(mid$(szDestPath, 1,1)) = 0 then
  218.             szDestPath = szOldDestPath
  219.             UIPop 1
  220.             BadPath
  221.             goto GetPathDlg
  222.         end if
  223.  
  224.         ' check for "foreign" chars in path
  225.         slength% = len(szDestPath)
  226.         found% = 0
  227.         for i% = 1 to slength%
  228.             if asc(mid$(szDestPath, i%, 1)) > 126 then
  229.                 found% = 1
  230.             end if
  231.         next i%
  232.         if found% = 1 then
  233.             szDestPath = szOldDestPath
  234.             UIPop 1
  235.             BadPath
  236.             goto GetPathDlg
  237.         end if
  238.  
  239.         wDrive% = asc(mid$(szDestPath, 1,1)) - asc("A")
  240.         if IsCDROMDrive(wDrive%) > 0 then
  241.             szDestPath = szOldDestPath
  242.             UIPop 1
  243.             BadPath
  244.             goto GetPathDlg
  245.         end if
  246.  
  247.         if IsDriveNetwork(mid$(szDestPath,1,1)) = 1 then
  248.             szDestPath = szOldDestPath
  249.             UIPop 1
  250.             NetworkDrive
  251.             goto GetPathDlg
  252.         end if
  253.  
  254.         if IsDirWritable(szDestPath) = 0 then
  255.             szDestPath = szOldDestPath
  256.             UIPop 1
  257.             BadPath
  258.             goto GetPathDlg
  259.         end if
  260.  
  261.         'check dir names not > 8 chars
  262.         dirlength% = 0
  263.         i% = 3
  264.         while i% <> slength%
  265.             i% =i%+1
  266.             dirlength% = dirlength% +1
  267.             if mid$(szDestPath, i%, 1)="\" then
  268.                 if dirlength% > 9 then
  269.                     szDestPath = szOldDestPath
  270.                     dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  271.                     goto GetPathDlg
  272.                  else
  273.                     dirlength% = 0
  274.                 endif
  275.             end if
  276.  
  277.         wend
  278.         if dirlength% > 8 then
  279.             szDestPath = szOldDestPath
  280.             dButton = DoMsgBox( STR_DIRTOOLONG, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  281.             goto GetPathDlg
  282.         endif
  283.  
  284.  
  285.   '      if DoesDirExist(szDestPath) = 0 then
  286.   '          dButton = DoMsgBox( STR_DIRNOTEXIST, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  287.   '          if dButton = 7 then
  288.   '              goto GetPathDlg
  289.   '          end if
  290.   '      end if
  291.  
  292.         UIPop 1
  293.  
  294.     case "EXIT" , "CANCEL"
  295.         AskQuit
  296.         goto GetPathDlg
  297.     end select
  298.  
  299. GetCustomChoicesDlg:
  300.     SetSymbolValue "CheckItemsState", ""
  301. '    AddListItem "CheckItemsState", szMinimalInstall
  302. '    AddListItem "CheckItemsState", szAddPMItem
  303. GetCustomChoicesLoop:
  304.  
  305.     ClearCopyList
  306. '    if szMinimalInstall = "OFF" then
  307.         AddFilesToCopyList "FULL"
  308. '    else
  309. '        AddFilesToCopyList "MINIMAL"
  310. '    end if
  311.  
  312.     dDestDrive = asc(mid$(szDestPath, 1,1)) - asc("A")+1
  313.     dWinDrive = asc(mid$(szWinPath, 1,1)) - asc("A")+1
  314.  
  315.     SetSymbolValue "DriveStatusText", ""
  316.     AddListItem "DriveStatusText", mid$(szDestPath, 1,1) + ":"
  317.     AddListItem "DriveStatusText", str$(GetDiskSpaceNeeded(dDestDrive) / 1024) + " K"
  318.     AddListItem "DriveStatusText", str$(GetFreeSpaceForDrive(mid$(szDestPath, 1,1))/1024) + " K"
  319.  
  320.     if dDestDrive = dWinDrive then
  321.         AddListItem "DriveStatusText", ""
  322.         AddListItem "DriveStatusText", ""
  323.         AddListItem "DriveStatusText", ""
  324.     else
  325.         AddListItem "DriveStatusText", mid$(szWinPath, 1,1) + ":"
  326.         AddListItem "DriveStatusText", str$(GetDiskSpaceNeeded(dWinDrive)/ 1024 ) + " K"
  327.         AddListItem "DriveStatusText", str$(GetFreeSpaceForDrive(mid$(szWinPath, 1,1))/1024) + " K"
  328.     end if
  329.  
  330.     AddListItem "DriveStatusText", szDestPath
  331.  
  332. ChooseInstall:
  333.  
  334.     szButton = UIStartDlg(CUIDLL_FILENAME, IDD_CUSTOM, "FCustInstDlgProc", IDD_CUSTOMHELP, PROC_HELP)
  335.  
  336. '    szMinimalInstall = GetListItem("CheckItemsState", 1)
  337. '    szAddPMItem = GetListItem("CheckItemsState", 2)
  338.  
  339.     select case szButton
  340.     case "REACTIVATE"
  341.         goto GetCustomChoicesLoop
  342.     case "BACK"
  343.         UIPop 1
  344.         goto GetPathDlg
  345.     case "CONTINUE"
  346.         UIPop 1
  347.     case "EXIT" , "CANCEL"
  348.         AskQuit
  349.         goto GetCustomChoicesLoop
  350.     end select
  351.  
  352.     ClearCopyList
  353. '    if szMinimalInstall = "OFF" then
  354.         AddFilesToCopyList "FULL"
  355. '    else
  356. '        AddFilesToCopyList "MINIMAL"
  357. '    end if
  358.     goto CommonInstallLoop
  359.  
  360. ExpressInstallLoop:
  361.     AddFilesToCopyList "FULL"
  362.     goto CommonInstallLoop
  363.  
  364. CommonInstallLoop:
  365.     InitCommonInstall
  366.  
  367.     if szMinimalInstall = "ON" and GetFreeSpaceForDrive(mid$(szDestPath,1,1)) < MINIMUM_DISK_SPACE then
  368.         error ERR_NODISKSPACE
  369.     elseif GetFreeSpaceForDrive(mid$(szDestPath,1,1)) < GetDiskSpaceNeeded( asc(mid$(szDestPath, 1,1))-asc("A")+1 ) then
  370.         error ERR_NODISKSPACE
  371.     end if
  372.  
  373. '+++
  374. '$IFDEF WITH_SAMPLER OR USE_WING
  375.  
  376.     UpdateWinGDrivers
  377.     UpdateIndeoAVIDrivers
  378.  
  379. '$ENDIF
  380. '---
  381.  
  382. 'IF USE SPECIFIC FONTS
  383. '    UpdateFonts
  384.  
  385.  
  386. '+++
  387. '$IFDEF UNINSTALL OR MUSEUM
  388.  
  389.     CreateIniKeyValue "Win.ini", "MMAPP", WIN_INI_ENTRY, szWinDrive+":"+DKREG_INI_PATH, cmoOverwrite
  390.     CreateReg
  391.  
  392. '$ENDIF
  393. '---
  394.  
  395.     Install
  396.  
  397.     CreateProgmanGroup STR_COMPANYNAME, "", cmoNone
  398.     ShowProgmanGroup   STR_COMPANYNAME, 1, cmoNone
  399. '    szReadmeTitle$ = STR_PRODUCTNAME + " " + STR_README 'not used now
  400.  
  401. '+++
  402. '$IFDEF WITH_SAMPLER
  403.  
  404.     szSamplerPath$ = MakePath( mid$(szSrcSetupPath, 1, (len(szSrcSetupPath) - len(SOURCE_SETUP_SUBDIR))-1), SAMPLER_PATH)
  405.     szSamplerPath$ = MakePath(szSamplerPath$, SAMPLER_EXE_FILE)
  406. '    if szMinimalInstall = "ON" then
  407. '        szInf$ = MakePath(szSrcBinPath, APPLICATION_MENU_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
  408. '        CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  409. '         CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
  410. '    else
  411.         szInf$ = MakePath(szDestPath, APPLICATION_MENU_FILE) + " " + MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, APPLICATION_PENGE_FILE) + " " + szSamplerPath$
  412.         CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  413.         CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
  414.         CreateProgmanItem STR_COMPANYNAME, STR_ORDER, EDITOR_EXE + MakePath(szDestPath, ORDER_FILE), "", cmoOverwrite
  415. '    end if
  416.  
  417. '$ELSE
  418.  
  419.     'NO SAMPLER
  420. '    if szMinimalInstall = "ON" then
  421. '        szInf$ = MakePath(szSrcBinPath, APPLICATION_EXE_FILE) + " " + MakePath(szSrcBinPath, "dkpage")'APPLICATION_PENGE_FILE)
  422. '        CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  423. '        CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szSrcBinPath, APPLICATION_README_FILE), "", cmoOverwrite
  424. '    else
  425.         szInf$ = MakePath(szDestPath, APPLICATION_EXE_FILE) + " " + MakePath(szDestPath, "dkpage")'APPLICATION_PENGE_FILE)
  426.         CreateProgmanItem STR_COMPANYNAME, STR_PRODUCTNAME, szInf, szInf, cmoOverwrite
  427.         CreateProgmanItem STR_COMPANYNAME, STR_README, EDITOR_EXE + MakePath(szDestPath, APPLICATION_README_FILE), "", cmoOverwrite
  428.         CreateProgmanItem STR_COMPANYNAME, STR_ORDER, EDITOR_EXE + MakePath(szWinDrive + ":" + DKREG_INI_DIR, ORDER_FILE), "", cmoOverwrite
  429. '    end if
  430.  
  431. '$ENDIF
  432. '---
  433.  
  434.  
  435. '+++
  436. '$IFDEF UNINSTALL
  437.  
  438.     'Uninstall icon
  439.     szDKUninstall$ = szWinDrive + ":" +  DKREG_INI_DIR
  440.     szInf$ = MakePath( szDKUninstall, UNINSTALL_EXE_FILE)
  441.     CreateProgmanItem STR_COMPANYNAME, STR_UNINSTALL, szInf, szInf, cmoOverwrite
  442.  
  443. '$ENDIF
  444. '---
  445.  
  446.  
  447. '+++
  448. '$IFDEF DEBUG
  449.  
  450.     DumpCopyList MakePath(szDestPath, "copylist.txt")
  451.  
  452. '$ENDIF ''DEBUG
  453. '---
  454.  
  455.  
  456.     EndCommonInstall APPLICATION_README_FILE, 0, EDITOR_EXE
  457.  
  458. quit:
  459.     on error goto quit
  460.  
  461.     select case ERR
  462.  
  463.     case 0
  464.         hDlg = IDD_EXITSUCCESS
  465.     case STFQUIT
  466.         hDlg = IDD_EXITQUIT
  467.     case ERR_NODISKSPACE
  468.         hDlg = IDD_NODISKSPACE
  469.     case else
  470.         hDlg = IDD_EXITFAILURE
  471.     end select
  472.  
  473.     UIPop 10
  474. quit2:
  475.     szButton = UIStartDlg(CUIDLL_FILENAME, hDlg, "FInfo0DlgProc", 0, "")
  476.     select case szButton
  477.     case "REACTIVATE"
  478.         goto quit2
  479.     end select
  480.  
  481.     UIPop 1
  482.     DeInitialise
  483.     stop
  484.     end
  485.  
  486. quitError:
  487.     dButton = DoMsgBox (STR_QUITERROR, STR_MSGCAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
  488.     DeInitialise
  489.     stop
  490.     end
  491.  
  492.  
  493. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  494.  
  495. Sub Install() STATIC
  496.  
  497.     cursor% = ShowWaitCursor()
  498.     CreateDir szDestPath, cmoNone
  499.     SetRestartDir szDestPath
  500.     RestoreCursor(cursor%)
  501.  
  502.     CopyFilesInCopyList  'creates dir even if min install
  503.  
  504. '+++
  505. '$IFDEF WITH_SAMPLER OR USE_WING
  506.  
  507.     Run ("regedit.exe /s " + MakePath(szWinPath, "mplayer.reg"))
  508.     Run ("regedit.exe /s " + MakePath(szWinSysPath, "OLE2.reg"))
  509.     Run ("regedit.exe /s " + MakePath(szWinSysPath, "cleanup.reg"))
  510.     Run ("profdisp.exe")
  511.  
  512. '$ENDIF
  513. '---
  514.  
  515.     if INI_FILE_SOURCE = "AppPath" then
  516.         szAppINIPath = MakePath(szDestPath, APPLICATION_INI_FILE)
  517.     else
  518.         szAppINIPath = MakePath(szWinPath, APPLICATION_INI_FILE)
  519.     end if
  520.  
  521.        '=d:\                                    =d:\dksetup                =dksetup
  522.     szPengePath = mid$(szSrcSetupPath, 1,len(szSrcSetupPath)-len(SOURCE_SETUP_SUBDIR)-2) ' -2 removes backslash
  523.  
  524. '+++
  525. '$IFDEF SCRUNGED
  526.  
  527. '    if szMinimalInstall = "OFF"  then
  528.         'data =
  529.         CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, szPengePath, cmoOverwrite
  530. '    endif
  531.  
  532. '$ELSE
  533.  
  534.     'DEBUG VERSION
  535.     'data =
  536. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, PRODUCT_INI_DIR_ENTRY_NAME, MakePath(szPengePath,"data"), cmoOverwrite
  537.     'pages =
  538. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Pages", MakePath(szPengePath,"dkpage"), cmoOverwrite
  539. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Scrunge", "0", cmoOverwrite
  540. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Developer", "1", cmoOverwrite
  541. '    CreateIniKeyValue szAppINIPath, PRODUCT_INI_DIR_SECTION_NAME, "Debug", "1", cmoOverwrite
  542.  
  543. '$ENDIF
  544. '---
  545.  
  546. End Sub
  547.  
  548.  
  549. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  550. Sub AddFilesToCopyList(szInstallType$) STATIC
  551.     cursor% = ShowWaitCursor()
  552.  
  553.     'Shared Files : For ORDER.WRI & FOR MUSEUM TITLES (DKSWTCHW.EXE)
  554.     AddSectionFilesToCopyList SETUP_INI_SH_BINARIES_SECTION_NAME, szSrcBinPath, szWinDrive + ":" + DKREG_INI_DIR
  555.  
  556. '+++
  557. '$IFDEF UNINSTALL
  558.  
  559.     szDKUninstall$ = szWinDrive + ":" +  DKREG_INI_DIR
  560.     AddSectionFilesToCopyList "UNINSTALL", szSrcBinPath, szDKUninstall
  561.  
  562. '$ENDIF
  563. '---
  564.  
  565. '    select case szInstallType
  566. '    case "FULL"
  567.         AddSectionFilesToCopyList SETUP_INI_BINARIES_SECTION_NAME, szSrcBinPath, szDestPath
  568.  
  569. '    case "MINIMAL"
  570. '        ' nothing
  571. '    end select
  572.  
  573.  
  574. '+++
  575. '$IFDEF WITH_SAMPLER OR USE_WING
  576.  
  577.     AddSectionFilesToCopyList SETUP_INI_WING_BINARIES_NAME, szSrcBinPath, szWinSysPath
  578.     AddSectionFilesToCopyList SETUP_INI_WING32_BINARIES_NAME, szSrcBinPath, szWinSysPath
  579.     AddSectionFilesToCopyList "VfW Runtime", szSrcBinPath, szWinSysPath
  580.     AddSectionFilesToCopyList "OLE2", szSrcBinPath, szWinSysPath
  581.     AddSectionFilesToCopyList "ACM Drivers", szSrcBinPath, szWinSysPath
  582.     AddSectionFilesToCopyList "MPlayer", szSrcBinPath, szWinPath
  583.     AddSectionFilesToCopyList "AVICodecs", szSrcBinPath, szWinSysPath
  584.  
  585. '$ELSE
  586.  
  587.     if fSystemUpdated = 1 then
  588.         AddSectionFilesToCopyList "ACM Drivers", szSrcBinPath, szWinSysPath
  589.     end if
  590.  
  591. '$ENDIF
  592. '---
  593.  
  594.     RestoreCursor(cursor%)
  595. End Sub
  596.  
  597. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  598. 'IF USING SPECIFIC FONTS
  599. 'Sub UpdateFonts() STATIC
  600. '    ' Check TT enabled
  601. '    MakeListFromSectionFilename "Fonts_list", "Fonts"
  602. '
  603. '    listLength% = GetListLength("Fonts_list")
  604. '    if listLength% > 0 then
  605. '        for item% = 1 to listLength%
  606. '            szFontFile$ = GetListItem("Fonts_list", item%)
  607. '            ' Check if exists
  608. '            'Install font
  609. '            ret% = InstallFont(MakePath(szSrcBinPath, szFontFile))
  610. '            ' Write WIN.INI
  611. '        next
  612. '    end if
  613. 'End Sub
  614.  
  615. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  616. Sub CreateReg() STATIC
  617.  
  618.     szDKREgIni$ = szWinDrive + ":" +  DKREG_INI_PATH
  619.     szProdName$ = STR_PRODUCTNAME
  620.     if DoesFileExist( szDKREgIni$, femExist) = 0 then
  621.         'dkreg.ini doesn't exist - initialize AppCount, create dir, add to InstalledApp
  622.         AppCount% = 1
  623.         CreateDir (szWinDrive+":"+DKREG_INI_DIR), cmoNone
  624.         CreateIniKeyValue szDKREgIni$, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
  625.         szNum$=str$(AppCount%)
  626.         CreateIniKeyValue szDKREgIni$, "InstalledApp",ltrim$(szNum), szProdName$, cmoOverwrite
  627.     else
  628.         if DoesIniSectionExist( szDKREgIni$, szProdName$ )=1  then
  629.             szDiffPath$=GetIniKeyString(szDKREgIni$, szProdName$, "Path")
  630.         '     if(szDestPath$  <> szDiffPath$) then
  631.                'product is already installed in a different dir - delete files and dir and ini section, don't change installed app section
  632.                ret% = DeleteFiles (szDiffPath, szProdName, szDKREgIni)
  633.                ret% = DeleteDir (szDiffPath)
  634.                ret% = DeleteSection(szProdName, szDKREgIni)
  635.         '      endif
  636.              'product is installed in same dir - do nothing, will overwrite
  637.         else
  638.               'product name does not exist - increment AppCount, add to InstalledApp
  639.                szAppCount$ = GetIniKeyString( szDKREgIni$, "InstalledApp", "Applications" )
  640.                AppCount% = Val(szAppCount$) + 1
  641.                CreateIniKeyValue szDKREgIni$, "InstalledApp", "Applications", str$(AppCount%), cmoOverwrite
  642.                'assign product to first available number (maybe gaps due to deletion)
  643.                i%=1
  644.                while( GetIniKeyString( szDKREgIni$, "InstalledApp",str$(i%) )<>"")
  645.                    i=i+1
  646.                wend
  647.                szNum$=str$(i%)
  648.                CreateIniKeyValue szDKREgIni$, "InstalledApp",ltrim$(szNum), szProdName$, cmoOverwrite
  649.         endif
  650.      endif
  651.  
  652.     CreateIniKeyValue szDKREgIni$, "InstalledApp","RecentLang", LANG_DLL, cmoOverwrite
  653.     CreateIniKeyValue szDKREgIni$, szProdName$, "Path", szDestPath, cmoOverwrite
  654.     CreateIniKeyValue szDKREgIni$, szProdName$, "Company", STR_COMPANYNAME, cmoOverwrite
  655.     CreateIniKeyValue szDKREgIni$, szProdName$, "Readme", STR_README, cmoOverwrite
  656.     CreateIniKeyValue szDKREgIni$, szProdName$, "Order", STR_ORDER, cmoOverwrite
  657.     CreateIniKeyValue szDKREgIni$, szProdName$, "Exe", APPLICATION_EXE_FILE, cmoOverwrite
  658.     CreateIniKeyValue szDKREgIni$, szProdName$, "1", APPLICATION_INI_FILE , cmoOverwrite  'Ini
  659. '    if szMinimalInstall = "OFF" then
  660.         MakeListFromSectionFilename "BIN_list", "BIN"
  661.         listLength% = GetListLength("BIN_list")
  662.         if listLength% > 0 then
  663.             for item% = 1 to listLength%
  664.                 szBinFile$ = GetListItem("BIN_list", item%)
  665.                 szNum$=str$(item%+1)
  666.                 CreateIniKeyValue szDKREgIni$, szProdName$, ltrim$(szNum), szBinFile , cmoOverwrite
  667.             next
  668.         end if
  669. '    end if
  670.  
  671. '    listLength% = GetListLength("Fonts_list")
  672. '    if listLength% > 0 then
  673. '        for item% = 1 to listLength%
  674. '            szFontFile$ = GetListItem("Fonts_list", item%)
  675. '            szNum$=str$(item%)
  676. '            CreateIniKeyValue szDKREgIni$, szProdName$,"F"+ltrim$(szNum), szFontFile, cmoOverwrite
  677. '        next
  678. '    end if
  679.  
  680. End Sub
  681.  
  682.